<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 遍历所有学生的信息
        let students = [
            { name: '小明', age: 18, gender: '男', hometown: '河北省' },
            { name: '小红', age: 19, gender: '男', hometown: '河南省' },
            { name: '小刚', age: 30, gender: '女', hometown: '陕西省' },
            { name: '小李', age: 28, gender: '女', hometown: '广东省' },
        ]

        // 遍历所有学生姓名,年龄，性别，籍贯
        for (let i = 0; i < students.length; i++) {

            // console.log(students[i]);
            console.log(students[i].name);
            console.log(students[i].age);
            console.log(students[i].gender);
            console.log(students[i].hometown);
            console.log('----------------------');
        }
    </script>
</body>

</html>